import React,{Component} from 'react';
import { Breadcrumb } from 'antd';
import { useSelector } from 'react-redux';
import { getConstant } from '../utils/tools';

interface Props{

}
function MyBread(props:Props) {
    var keypath = useSelector((state:any)=>state.keypath)
    keypath.reverse()
    
    return (
        <div className='mybread'>
                <Breadcrumb>
                    <Breadcrumb.Item>首页</Breadcrumb.Item>
                    {
                        keypath.map((item:any,index:number)=>{
                            return (
                                <Breadcrumb.Item key={index}>
                                    { getConstant(item) }
                                </Breadcrumb.Item>
                            )
                        })
                    }
                </Breadcrumb>
            </div>
    );
}

export default MyBread;